package com.otitan.la.forest.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 应用表
 *
 * @author jiacs
 * @email xxx
 * @date 2020-09-15 14:51:37
 */
@Data
@TableName("\"SYS_APPLICATION\"")
@ApiModel("应用表实体")
public class ApplicationEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键", required = true)
    @TableId("\"ID\"")
    private String id;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称", required = true)
    @NotEmpty(message = "名称不能为空")
    @Length(max = 20, message = "名称不能超过 20 个字符")
    @TableField("\"NAME\"")
    private String name;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序", required = true)
    @NotNull(message = "排序不能为空")
    @Max(value = 999, message = "排序不能超过 999")
    @Min(value = 0, message = "排序不能小于 0")
    @TableField("\"ORDER_NO\"")
    private Integer orderNo;

    /**
     * 图标
     */
    @ApiModelProperty(value = "图标", required = false)
    @TableField("\"ICON\"")
    private String icon;

    /**
     * 路由路径
     */
    @ApiModelProperty(value = "路由路径", required = false)
    @Length(max = 128, message = "路由路径不能超过 128 个字符")
    @TableField("\"PATH\"")
    private String path;

    /**
     * 应用编码
     */
    @ApiModelProperty(value = "应用编码", required = true)
    @NotEmpty(message = "应用编码不能为空")
    @Length(max = 30, message = "应用编码不能超过 30 个字符")
    @TableField("\"APP_CODE\"")
    private String appCode;

    /**
     * 打开方式
     */
    @ApiModelProperty(value = "打开方式（本系统路径、打开新网页、系统嵌入）", required = true)
    @Length(max = 30, message = "打开方式不能超过 30 个字符")
    @TableField("\"OPEN_TYPE\"")
    private String openType;

    /**
     * 打开新网页或系统嵌入地址
     */
    @ApiModelProperty(value = "打开新网页或系统嵌入地址", required = false)
    @Length(max = 128, message = "外部服务地址不能超过 128 个字符")
    @TableField("\"URL\"")
    private String url;

    /**
     * 类别
     */
    @ApiModelProperty(value = "类别", required = false)
    @TableField("\"CATEGORY\"")
    private String category;

    /**
     * 应用类型
     */
    @ApiModelProperty(value = "应用类型", required = false)
    @TableField("\"TYPE\"")
    private String type;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述", required = false)
    @Length(max = 150, message = "描述不能超过 150 个字符")
    @TableField("\"REMARK\"")
    private String remark;

    /**
     * 创建用户
     */
    @ApiModelProperty(value = "创建用户", required = false)
    @TableField(value = "\"CREATE_USER\"", fill = FieldFill.INSERT)
    private String createUser;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", required = false)
    @TableField(value = "\"CREATE_DATE\"", fill = FieldFill.INSERT)
    private Date createDate;

    /**
     * 编辑用户
     */
    @ApiModelProperty(value = "编辑用户", required = false)
    @TableField(value = "\"UPDATE_USER\"", fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    /**
     * 编辑时间
     */
    @ApiModelProperty(value = "编辑时间", required = false)
    @TableField(value = "\"UPDATE_DATE\"", fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

    /**
     * 是否删除
     */
    @ApiModelProperty(value = "是否删除", required = false)
    @TableField(value = "\"IS_DELETE\"", fill = FieldFill.INSERT)
    @TableLogic  //逻辑删除注解
    @JsonIgnore  //忽略
    private Integer isDelete;


}
